package tencent;

import java.util.Scanner;

/**
 * @author habitplus
 * @since 2021-08-22 21:57
 */
public class T20210822N4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        in.nextLine();
        String s = in.nextLine();

        T20210822N4 test = new T20210822N4();
        System.out.println(test.handle(s, k));


    }

    public String handle(String s, int k) {

        if (s == null || s.length() == 0 || s.length() < k) {
            return "";
        }

        char[] chs = s.toCharArray();
        int n = chs.length;
        if (n == k) {
            return s;
        }

        int i = -1;
        int j = n - k;
        StringBuilder sb = new StringBuilder();
        while (i <= j && j < n) {
            i = findMax(chs, i + 1, j);
            sb.append(chs[i]);
            j++;
        }

        return sb.toString();
    }

    private int findMax(char[] ch, int l, int r) {
        int idx = l;
        char maxChar = ch[l];
        for (int i = l; i <= r; i++) {
            if (maxChar < ch[i]) {
                maxChar = ch[i];
                idx = i;
            }
        }
        return idx;
    }
}
